#include <windows.h>
#include "CCSPositionPacket.h"

CCSPositionPacket::CCSPositionPacket(CChar * schar,struct position pos) {
	unsigned int id			= schar->getId();
	unsigned short targid	= schar->getTargId();
	memset(this->data, 0, sizeof(this->data));
	this->type = 0x65;
	this->size = 0x10;
	memcpy(this->data, &pos.x, sizeof(pos.x));
	memcpy(this->data+4, &pos.y, sizeof(pos.y));
	memcpy(this->data+8, &pos.z, sizeof(pos.z));
	
	memcpy(this->data+12, &(id), sizeof(unsigned int));
	memcpy(this->data+16, &(targid), sizeof(unsigned short));
	memcpy(this->data+19, &(pos.rotation),sizeof(pos.rotation));
	this->data[0x16 - 0x04] = 0x01;  //unknown
	this->data[0x18 - 0x04] = 0x01;  //unknown
}

CCSPositionPacket::~CCSPositionPacket() {

}
